package com.tinycloud.miracll.finance.job;


import com.tinycloud.miracll.finance.service.IProductCostService;
import com.tinycloud.miracll.finance.service.ISapProductOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;

@Service
public class ProductCostTask {

    @Autowired
    IProductCostService productCostService;

    @Autowired
    ISapProductOrderService sapProductOrderService;

    public  void createProductCost () throws ParseException {

        sapProductOrderService.deleteSapProductOrderByParam(null);
        productCostService.deleteFirstProductCostByParams(null);
        productCostService.deleteSecondProductCostByParams(null);
        productCostService.deleteLastProductCostByParams(null);

        sapProductOrderService.insertAllSapProductOrder();
        productCostService.firstProductCostList();
        productCostService.secondProductCostList();
        productCostService.lastProductCostList();

        productCostService.deleteERPProductCostByParams(null);
        productCostService.insertERPProductCost();

    }


}
